using System.Collections.ObjectModel;
using HMCollada.Core;
using System.Xml;

namespace HMCollada.Core {
    internal struct HMColladaVertices {
        internal string id;
        internal string name;
        internal Collection<HMColladaInput> input;
    }
}

namespace HMCollada {
    internal partial class HMColladaLoader {
        private static HMColladaVertices LoadVertices() {
            HMColladaVertices newVertices = new HMColladaVertices();
            newVertices.id = colladaReader.GetAttribute("id");
            newVertices.name = colladaReader.GetAttribute("name");

            newVertices.input = new Collection<HMColladaInput>();

            if (!colladaReader.IsEmptyElement) colladaReader.Read();
            do {
                if (colladaReader.NodeType != XmlNodeType.EndElement) {
                    switch (colladaReader.Name) {
                        case "input": newVertices.input.Add(LoadInput()); break;
                    }
                }

                if (!colladaReader.IsEmptyElement) colladaReader.Read();
            } while (colladaReader.Name != "vertices");

            if (colladaReader.IsEmptyElement) colladaReader.Read();
            return newVertices;
        }
    }
}